<template>
	<view class="loading" v-if="loading">
		<image src="../../pages-sub/static/images/common/ailoading.gif" class="loading-img" mode="widthFix"></image>
		<view style="color: #fff; text-align: center;">
			<text>亲，请稍等1分钟，我正在全力思考中，\r\n一会儿就写完喽…</text>
		</view>
		<view class="title" @click="onclick">
			<text>{{title}}</text>
		</view>
	</view>
</template>

<script>
	export default {
		name: "rf-loading",
		props: {
			loading: {
				type: Boolean,
				required: true
			},
			bgColor: {
				type: String,
				required: true
			},
			title: {
				type: String,
				required: true
			}
		},
		data() {
			return {

			};
		},
		methods: {
			onclick() {
				this.$emit("click", "")
			}
		}
	}
</script>
<style lang="scss" scoped>
	.loading {
		position: fixed;
		z-index: 9999;
		left: 0;
		top: 0;
		width: 100%;
		height: 100%;

		background-color: rgba(0, 0, 0, 0.7);

		display: flex;
		flex-direction: column;
		justify-content: center;
		align-items: center;


		.loading-img {
			width: 400rpx;
			height: 400rpx;
		}

		.title {
			margin-top: 20rpx;
			background-color: rgba(119, 198, 113, 1);
			height: 80rpx;
			border-radius: 40rpx;
			color: #fff;
			padding: 0 40rpx;
			display: flex;
			justify-content: center;
			align-items: center;
		}
	}
</style>